﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EventScavenger
{
    [Serializable]
    public class PresetProfile
    {
        public PresetProfile() { }
        public PresetProfile(string name)
        {
            this.name = name;
        }

        #region Properties
        private string name;
        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        private int eventLogEntryType = 0;
        public int EventLogEntryType
        {
            get { return eventLogEntryType; }
            set { eventLogEntryType = value; }
        }
        private bool showAllLogs = true;
        public bool ShowAllLogs
        {
            get { return showAllLogs; }
            set { showAllLogs = value; }
        }
        private List<MachineLogEntry> machineLogs = new List<MachineLogEntry>();
        public List<MachineLogEntry> MachineLogs
        {
            get { return machineLogs; }
            set { machineLogs = value; }
        }
        private bool showAllEventIDs = true;
        public bool ShowAllEventIDs
        {
            get { return showAllEventIDs; }
            set { showAllEventIDs = value; }
        }
        private List<int> eventIds = new List<int>();
        public List<int> EventIds
        {
            get { return eventIds; }
            set { eventIds = value; }
        }
        private bool showAllSources = true;
        public bool ShowAllSources
        {
            get { return showAllSources; }
            set { showAllSources = value; }
        }
        private List<string> sources = new List<string>();
        public List<string> Sources
        {
            get { return sources; }
            set { sources = value; }
        }
        #endregion

        static public PresetProfile LoadFilterProfileFromFile(string profilePath)
        {
            System.Xml.XmlDocument xdoc = new System.Xml.XmlDocument();

            xdoc.Load(profilePath);
            return (PresetProfile)Serializer.DeserializeXML(xdoc.OuterXml, typeof(PresetProfile));
        }
    }
}
